package com.bds.btcdc.web.model.common;

import java.io.Serializable;
import java.util.Calendar;

import com.bds.btcdc.web.model.TUser;
import com.bds.btcdc.web.utils.Const;

/**
 * Created by guoyu on 2018/1/29.
 */
public class UserSession implements Serializable {
	public final static String sessionKey = "sessionContext";
	public final static String verifyCode = "verifyCode";

	private TUser user;
	private String user_name;
	private Long user_id;
	private String role;
	private Long login_date;// 登录时间
	private Integer rememberme_time;// 密码记住多久

	public UserSession(TUser user) {
		this.user = user;
		this.user_name = user.getUsername();
		this.user_id = user.getId();
		this.role = user.getRole();
		this.login_date = Calendar.getInstance().getTimeInMillis();
		this.rememberme_time = Const.REMEMBERME_TIME;
	}

	public String getUser_name() {
		return user_name;
	}

	public void setUser_name(String user_name) {
		this.user_name = user_name;
	}

	public TUser getUser() {
		return this.user;
	}

	public Long getUser_id() {
		return user_id;
	}

	public void setUser_id(Long user_id) {
		this.user_id = user_id;
	}

	public void setUser(TUser user) {
		this.user = user;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public Long getLogin_date() {
		return login_date;
	}

	public void setLogin_date(Long login_date) {
		this.login_date = login_date;
	}

	public Integer getRememberme_time() {
		return rememberme_time;
	}

	public void setRememberme_time(Integer rememberme_time) {
		this.rememberme_time = rememberme_time;
	}
}
